class EventData{
    constructor(index,id,name){
        this.index = index;
        this.id = id;
        this.name = name;
        this.aid = '';
        this.tid = '';
        this.tname = '';
        this.actiontype = '';
        this.sounds = [];
    }

    addAction(aid,actiontype,tid,tname){
        this.aid = aid;
        this.tid = tid;
        this.tname = tname;
        this.parseActionType(actiontype);
    }

    addSound(sounddata){
        this.sounds.push(sounddata);
    }

    parseActionType (type){
        switch (type){
            case 1:
                this.actiontype = '/Play';
                break;
            case 2:
                this.actiontype = '/Stop/Stop';
                break;
            case 3:
                this.actiontype = '/Stop/Stop All';
                break;
            case 4:
                this.actiontype = '/Mute/Mute';
                break;
            case 5:
                this.actiontype = '/Mute/UnMute';
                break;
            case 6:
                this.actiontype = '/Mute/UnMute All';
                break;
            case 7:
                this.actiontype = '/Pause/Pause';
                break
            case 8:
                this.actiontype = '/Pause/Pause All';
                break;
            case 9:
                this.actiontype = '/Pause/Resume';
                break;
            case 10:
                this.actiontype = '/Pause/Resume All';
                break;
            case 11:
                this.actiontype = '---/Bus Volume/Set Bus Volume';
                break;
            case 12:
                this.actiontype = '/Voice Volume/Set Voice Volume';
                break;
            case 13:
                this.actiontype = '/Voice Pitch/Set Voice Pitch';
                break;
            case 14:
                this.actiontype = '/Bus Volume/Reset Bus Volume';
                break;
            case 15:
                this.actiontype = '/Bus Volume/Reset Bus Volume All';
                break;
            case 16:
                this.actiontype = '/Voice Volume/Reset Voice Volume';
                break;
            case 17:
                this.actiontype = '/Voice Volume/Reset Voice Volume All';
                break;
            case 18:
                this.actiontype = '/Voice Pitch/Reset Pitch';
                break;
            case 19:
                this.actiontype = '/Voice Pitch/Reset Pitch All';
                break;
            case 20:
                this.actiontype = '/States/Enable State';
                break;
            case 21:
                this.actiontype = '/States/Disable State';
                break;
            case 22:
                this.actiontype = '/States/Set State';
                break;
            case 23:
                this.actiontype = '/Set Switch';
                break;
            case 24:
                this.actiontype = '---/Bypass Effect/Enable Bypass';
                break;
            case 25:
                this.actiontype = '/Bypass Effect/Disable Bypass';
                break;
            case 26:
                this.actiontype = '/Voice Low-pass Filter/Set LPF';
                break;
            case 27:
                this.actiontype = '/Voice Low-pass Filter/Reset LPF';
                break;
            case 28:
                this.actiontype = '/Voice Low-pass Filter/Reset LPF All';
                break;
            case 29:
                this.actiontype = '/Voice High-pass Filter/Set HPF';
                break;
            case 30:
                this.actiontype = '/Voice High-pass Filter/Reset HPF';
                break;
            case 31:
                this.actiontype = '/Voice High-pass Filter/Reset HPF All';
                break;
            case 32:
                this.actiontype = '/Bypass Effect/Reset Bypass Effect';
                break;
            case 33:
                this.actiontype = '/Bypass Effect/Reset Bypass Effect All';
                break;
            case 34:
                this.actiontype = '/Break';
                break;
            case 35:
                this.actiontype = '/Trigger';
                break;
            case 36:
                this.actiontype = '/Seek/Seek';
                break;
            case 37:
                this.actiontype = '/Seek/Seek All';
                break;
            case 38:
                this.actiontype = '---/Game Parameter/Set Game Parameter';
                break;
            case 39:
                this.actiontype = '/Game Parameter/Reset Game Parameter';
                break;
            case 40:
                this.actiontype = '/Release Envelope';
                break;
            case 41:
                this.actiontype = '/Post Event';
                break;
            case 42:
                this.actiontype = '/Reset Playlist';
                break;
        }
    }
}

module.exports = EventData;